package org.test.client.listener;

import java.awt.event.MouseEvent;
import java.util.List;

import javax.swing.JComponent;

import org.test.client.ui.component.window.BlackToolTip;

public class ToolTipMouseListener extends CommonMouseListener implements EnteredAction{
	
	protected BlackToolTip tp = null;
		
	public ToolTipMouseListener(JComponent comp,String toolTipStr) {
		super(comp);
		tp = new BlackToolTip(toolTipStr, comp);
		this.addEnteredAction(this);
	}
	
	public ToolTipMouseListener(JComponent comp,List<ClickAction> actions,String toolTipStr) {
		super(comp,actions);
		tp = new BlackToolTip(toolTipStr, comp);
		this.addEnteredAction(this);
	}

	@Override
	public Object doOnEntered(MouseEvent ev) {
		tp.showToolTip();
		return null;
	}

	@Override
	public Object doOnExited(MouseEvent ev) {
		tp.hideToolTip();
		return null;
	}
	
	
	
}
